// BUILDINGS
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.3.16 on Thu Mar 24 15:04:33 2022
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   struct <unnamed>
//   {
//
//       float4 vPlane;                 // Index:    0
//       float4 vSettings;              // Index:    1
//
//   } g_ClipPlane;                     // Index:    0 1              Components:     8 [unused]
//   int4 g_vnStartCascadeInstance;     // Index:    2.xyzw           Components:     4 [unused]
//      = 0x00000000 0x00000000 0x00000000 0x00000000
//   float4x4 g_mCloudsShadowsSpace;    // Index:    3 4 5 6          Components:    16 [unused]
//      = 0x00000000 0x00000000 0x00000000 0x00000000
//        0x00000000 0x00000000 0x00000000 0x00000000
//        0x00000000 0x00000000 0x00000000 0x00000000
//        0x00000000 0x00000000 0x00000000 0x00000000
//   float4 g_vCloudsShadowDesc;        // Index:    7.xyzw           Components:     4 [unused]
//      = 0x00000000 0x00000000 0x00000000 0x00000000
//   float4 g_vKSettings;               // Index:    8.xyzw           Components:     4
//   float4x4 g_mPrevObjViewProj;       // Index:    9 10 11 12       Components:    16
//   float4 g_vAmbientColor;            // Index:   13.xyzw           Components:     4
//   float4 g_vDefSettings;             // Index:   14.xyzw           Components:     4 [unused]
//   float4 specColor;                  // Index:   15.xyzw           Components:     4
//   float4 ControlData;                // Index:   16.xyzw           Components:     4 [unused]
//   float4 difColor;                   // Index:   17.xyzw           Components:     4
//   float4 ambient;                    // Index:   18.xyzw           Components:     4 [unused]
//   float4 g_vDefLightDir;             // Index:   19.xyzw           Components:     4 [unused]
//   float4 g_vDefLightColor;           // Index:   20.xyzw           Components:     4 [unused]
//   float4 g_vDefSpecColor;            // Index:   21.xyzw           Components:     4 [unused]
//   float4 g_vScreenDepthRect;         // Index:   22.xyzw           Components:     4 [unused]
//   float4 g_vVisibility;              // Index:   23.xyzw           Components:     4 [unused]
//      = 0x44480000 0x42c80000 0x3f800000 0x00000000
//   float4 g_vGPTransform;             // Index:   24.xyzw           Components:     4 [unused]
//      = 0x00000000 0x00000000 0x00000000 0x00000000
//   float4x4 g_mViewProj;              // Index:   25 26 27 28       Components:    16
//   float4 g_vCamPos;                  // Index:   29.xyzw           Components:     4 [unused]
//   float4 MASK[4];                    // Index:   30 31 32 33       Components:    16 [unused]
//      = 0x3f800000 0x00000000 0x00000000 0x00000000
//        0x00000000 0x3f800000 0x00000000 0x00000000
//        0x00000000 0x00000000 0x3f800000 0x00000000
//        0x00000000 0x00000000 0x00000000 0x3f800000
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// LerpSamplerAnis                   sampler      NA          NA    0        1
// g_tDiffTexture                    texture  float4          2d    0        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyz         1     NONE   float   xyz
// TEXCOORD                 1   xyz         2     NONE   float   xyz
// TEXCOORD                 2   xyz         3     NONE   float   xyz
// TEXCOORD                 3   xyzw        4     NONE   float
// TEXCOORD                 4   xyzw        5     NONE   float
// TEXCOORD                 5   xyz         6     NONE   float
// TEXCOORD                 6   xyzw        7     NONE   float
// TEXCOORD                 8   xyzw        8     NONE   float
// COLOR                    0   xyzw        9     NONE   float      w
// COLOR                    1   xyzw       10     NONE   float   xyz
// SV_ClipDistance          0   x          11  CLIPDST   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
// SV_Target                2   xyzw        2   TARGET   float   xyzw
// SV_Target                3   xy          3   TARGET   float   xy
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[29], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyz
dcl_input_ps linear v9.w
dcl_input_ps linear v10.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xy
dcl_temps 7
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v1.xyxx, t0.xyzw, s0
lt r1.x, r0.w, l(0.125000)
if_nz r1.x
  discard_nz l(-1)
  mov r1.xyzw, l(0,0,0,0)
  mov o1.xyz, l(0,0,0,0)
  mov r2.xy, l(0,0,0,0)
  mov o3.xy, l(0,0,0,0)
else
  dp3 r2.z, v3.xyzx, v3.xyzx
  rsq r2.z, r2.z
  mul r3.xyz, r2.zzzz, v3.xyzx
  add r2.z, r0.w, r0.w
  mad r0.w, r0.w, l(2.000000), l(-1.000000)
  max r0.w, r0.w, l(0.000000)
  add r0.w, r0.w, l(-1.000000)
  mad r0.w, cb0[17].w, r0.w, l(1.000000)
  mul r4.xyz, r0.wwww, cb0[15].xyzx
  lt r0.w, l(0.500000), v1.z
  if_nz r0.w
    mul r5.xyz, r0.xyzx, cb0[17].xyzx
  else
    mul r5.xyz, r0.xyzx, cb0[13].xyzx
  endif
  mul r0.xyz, r5.xyzx, l(1.700000, 1.700000, 1.700000, 0.000000)
  dp3 r0.w, r0.xyzx, l(0.333000, 0.333000, 0.333000, 0.000000)
  mul r0.xyz, r0.xyzx, v10.xyzx
  mad r6.xyz, r5.xyzx, l(1.700000, 1.700000, 1.700000, 0.000000), -r0.wwww
  dp3 r2.w, |r6.xyzx|, l(0.333000, 0.333000, 0.333000, 0.000000)
  add r0.w, r0.w, l(0.100000)
  div r0.w, r2.w, r0.w
  mul_sat r0.w, r0.w, l(5.000000)
  mad r5.xyz, r5.xyzx, l(1.700000, 1.700000, 1.700000, 0.000000), -r0.xyzx
  mad r1.xyz, r0.wwww, r5.xyzx, r0.xyzx
  min r0.x, r2.z, l(1.000000)
  mul r1.w, r0.x, v9.w
  mad o1.xyz, r3.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
  dp3 r2.x, r4.xyzx, l(0.333000, 0.333000, 0.333000, 0.000000)
  lt r0.x, cb0[8].x, l(0.500000)
  if_nz r0.x
    mov o3.xy, l(0,0,0,0)
  else
    mov r0.xyz, v2.xyzx
    mov r0.w, l(1.000000)
    dp4 r3.x, r0.xyzw, cb0[25].xyzw
    dp4 r3.y, r0.xyzw, cb0[26].xyzw
    dp4 r2.z, r0.xyzw, cb0[28].xyzw
    div r2.zw, r3.xxxy, r2.zzzz
    dp4 r3.x, r0.xyzw, cb0[9].xyzw
    dp4 r3.y, r0.xyzw, cb0[10].xyzw
    dp4 r0.x, r0.xyzw, cb0[12].xyzw
    div r0.xy, r3.xyxx, r0.xxxx
    add r0.xy, -r0.xyxx, r2.zwzz
    mul r0.z, -r0.y, cb0[8].y
    dp2 r0.y, r0.xzxx, r0.xzxx
    sqrt r0.y, r0.y
    lt r0.w, l(2.000000), r0.y
    if_nz r0.w
      div r0.y, l(2.000000), r0.y
      mul o3.xy, r0.yyyy, r0.xzxx
    else
      mov o3.xy, r0.xzxx
    endif
  endif
  mov r2.y, cb0[15].w
endif
lt r0.x, r1.w, l(0.875000)
if_nz r0.x
  mov o1.w, l(1.000000)
else
  mov o1.w, l(0)
endif
mov o0.xyzw, r1.xyzw
//mov o0.xyz, r1.xyz
mov o2.xy, r2.xyxx
mov o2.zw, l(0,0,0,0.075000) //// ALPHA
ret
